; *** Dodgem
; *** Copyright 1998-2002 Zillions Development
; v.2.0

; You need to purchase Zillions of Games to load this rules file
; Visit the Zillions web site at http://www.zillions-of-games.com

(version "2.0")

(translate
 ("Red" "红队") ("Blue" "蓝队")
 ("Car" "汽车")
 ("red-finish" "终点") ("blue-finish" "终点")
)

(game
    (title "停车场 3x3")
	(description "先将汽车开离停车场的获胜。车只能沿路标所指方向移动。无法移动的场合输。")
    (history "Dodgem was invented in 1972 by Colin Vout, a mathematics student at the
	  University of Cambridge in England.  Martin Gardner discussed it in the June
        1975 issue of Scientific American, and John Horton Conway and his colleagues
        analyzed the 3x3 game exhaustively in volume 2 of `Winning Ways`.")
    (strategy "The best move is often not to move a piece off the board, but instead to
        block your opponent's pieces -- but be careful to leave at least one legal move.
        With perfect play, Blue can always win on the 3x3 board.")
    (option "prevent flipping" true)
    (players Blue Red)
    (turn-order Blue Red)
    (opening-sound "Audio\\StartCar.wav")
    (win-sound "Audio\\Clapping.wav")
    (loss-sound "Audio\\DriveBy.wav")
    (move-sound "Audio\\Car.wav")
    (board
        (image "images\Dodgem\Dodgem33.bmp")
		(grid
          (start-rectangle 58 59 147 148)
          (dimensions
            ("a/b/c" (90 0)) ; files
            ("3/2/1" (0 90)) ; ranks
          )
          (directions (n 0 -1) (e 1 0) (s 0 1) (w -1 0))
        )
        (positions
            (red-finish   58   0 327  58)
            (blue-finish 328  59 396 327)
        )
        (links exit-n (a3 red-finish)  (b3 red-finish)  (c3 red-finish))
        (links exit-e (c1 blue-finish) (c2 blue-finish) (c3 blue-finish))
        (symmetry Red  (exit-e exit-n) (e n) (n w) (s e)) ; 90 degrees
    )
    (piece
        (image Red "images\Dodgem\RedCar.bmp" Blue "images\Dodgem\BlueCar.bmp")
		(description "车：只能按路标开。")
		(help "请遵守交通规则按路标开车。")
        (name Car)
        (moves
            (e (verify empty?) add)
            (n (verify empty?) add)
            (s (verify empty?) add)
            (exit-e (add Off-Board))
         )
    )
    (piece (name Off-Board) (dummy))
    (board-setup
        (Blue (Car a2 a3))
        (Red  (Car b1 c1))
    )
    (win-condition (Red) (pieces-remaining 0 Car))
    (win-condition (Blue) (pieces-remaining 0 Car))
    (win-condition (Red Blue) stalemated)
)

(variant
   (title "停车场 4x4")
   (strategy "The best move is often not to move a piece off the board, but instead to
      block your opponent's pieces.  In 1996, David desJardins analyzed both the 4x4
      and 5x5 games and concluded that both were drawn with best play, summarizing
      his results on the Internet newsgroup rec.games.abstract.")
   (board
        (image "images\Dodgem\Dodgem44.bmp")
		(grid
          (start-rectangle 52 29 102 79)
          (dimensions
            ("a/b/c/d" (67 0)) ; files
            ("4/3/2/1" (0 68)) ; ranks
          )
          (directions (n 0 -1) (e 1 0) (s 0 1) (w -1 0))
        )
        (positions
            (red-finish   52   0 303  28)
            (blue-finish 304  29 339 285)
        )
        (links exit-n (a4 red-finish)  (b4 red-finish)  (c4 red-finish) (d4 red-finish))
        (links exit-e (d1 blue-finish) (d2 blue-finish) (d3 blue-finish) (d4 blue-finish))
        (symmetry Red  (exit-e exit-n) (e n) (n w) (s e)) ; 90 degrees
    )
	(piece
        (image Red "images\Dodgem\RedCarsm.bmp" Blue "images\Dodgem\BlueCarsm.bmp")
		(description "车：只能按路标开。")
		(help "请遵守交通规则按路标开车。")
        (name Car)
        (moves
            (e (verify empty?) add)
            (n (verify empty?) add)
            (s (verify empty?) add)
            (exit-e (add Off-Board))
         )
    )
	(board-setup
        (Blue (Car a2 a3 a4))
        (Red  (Car b1 c1 d1))
    )
)

(variant
   (title "停车场 5x5")
   (strategy "The best move is often not to move a piece off the board, but instead to
      block your opponent's pieces.  In 1996, David desJardins analyzed both the 4x4
      and 5x5 games and concluded that both were drawn with best play, summarizing
      his results on the Internet newsgroup rec.games.abstract.")
   (board
        (image "images\Dodgem\Dodgem55.bmp")
		(grid
          (start-rectangle 51 26 101 76)
          (dimensions
            ("a/b/c/d/e" (54 0)) ; files
            ("5/4/3/2/1" (0 55)) ; ranks
          )
          (directions (n 0 -1) (e 1 0) (s 0 1) (w -1 0))
        )
        (positions
            (red-finish   51   0 316  25)
            (blue-finish 317  26 350 286)
        )
        (links exit-n (a5 red-finish)  (b5 red-finish)  (c5 red-finish) (d5 red-finish) (e5 red-finish))
        (links exit-e (e1 blue-finish) (e2 blue-finish) (e3 blue-finish) (e4 blue-finish) (e5 blue-finish))
        (symmetry Red  (exit-e exit-n) (e n) (n w) (s e)) ; 90 degrees
    )
	(piece
        (image Red "images\Dodgem\RedCarsm.bmp" Blue "images\Dodgem\BlueCarsm.bmp")
		(description "车：只能按路标开。")
		(help "请遵守交通规则按路标开车。")
        (name Car)
        (moves
            (e (verify empty?) add)
            (n (verify empty?) add)
            (s (verify empty?) add)
            (exit-e (add Off-Board))
         )
    )
	(board-setup
        (Blue (Car a2 a3 a4 a5))
        (Red  (Car b1 c1 d1 e1))
    )
)


